package com.app.base.service.core.company.controller;


import com.app.base.service.core.company.service.CompanyService;
import com.app.base.utlis.auth.JwtHelper;
import com.app.base.utlis.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 *  前端控制器
 * @author yuhag
 * @since 2022-05-09
 */
@RestController
@RequestMapping("/companyController")
@Api(tags = "公司管理")
public class CompanyController {

    @Resource
    private CompanyService companyService;

    @GetMapping("companyInfo")
    @ApiOperation("根据token获取公司信息")
    public Result companyInfo(HttpServletRequest request){
        String userId = JwtHelper.getMemberIdByJwtToken(request);
        return companyService.companyInfo(userId);
    }

}

